package com.edooteach.api.servcice.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.demo2do.core.persistence.GenericDaoSupport;
import com.edoomath.entity.mall.Sku;
import com.edooteach.api.servcice.SkuService;

/**
 * 
 * @author mohanlan
 *
 */
@Service("skuService")
public class SkuServiceImpl extends DataServiceImpl<Sku> implements SkuService {

    @Autowired
    private GenericDaoSupport genericDaoSupport;

    /*
     * (non-Javadoc)
     * @see com.edooteach.api.servcice.SkuService#listBookSku()
     */
    @SuppressWarnings("unchecked")
    public List<Sku> listBookSku() {
        String sentence = "FROM Sku WHERE type = :type AND disabled = false ORDER BY sorting ASC";
        return genericDaoSupport.searchForCacheableList(sentence, "type", "MAIL");
    }
}
